<template>
  <el-row class="row">
    <el-col :span="24">
      <OrderInfo
        :chOrder="chOrder"
        :orderConsigneeInfo="orderConsigneeInfo"
        :orderCosts="orderCosts"
        :productExtBeans="productExtBeans"
        :chServiceAppointmentDispatch="chServiceAppointmentDispatch"
        :chServiceCollectionCostList="chServiceCollectionCostList"
        toEdit
      ></OrderInfo>
    </el-col>
  </el-row>
</template>
<script>
import {dotData} from '@/utils'
import OrderInfo from '@/views/oms/orders/serviceOrders/detail/OrderInfo'
export default {
  name: 'serviceOrdersEditShow',
  components: {
    OrderInfo
  },
  data() {
    return {
      id: this.$route.params.id,
      chOrder: {},
      orderConsigneeInfo: {},
      chServiceAppointmentDispatch: {},
      orderCosts: [],
      productExtBeans: [],
      chServiceCollectionCostList: []
    }
  },
  created() {
    this.getDetail()
  },
  methods: {
    getDetail() {
      this.$ajax.get('/ms-terminal-order/orderData/getOrderDatails', {orderId: this.id}).then(response => {
        if (!response.data) {
          return
        }
        this.chOrder = response.data.chOrder || {}
        this.orderConsigneeInfo = response.data.chOrderConsigneeInfo || {}
        this.orderCosts = response.data.orderCosts || []
        this.productExtBeans = response.data.productExtBeans || []
        this.chServiceAppointmentDispatch = response.data.chServiceAppointmentDispatch || {}
        // 代收款费用信息
        this.chServiceCollectionCostList = dotData(response, 'data.chServiceCollectionCostList') || []
      })
    }
  }
}
</script>
